<!-------- @HEADER
 !
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !
 !  Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring
 !                  Copyright 2012 Sandia Corporation
 !
 ! Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
 ! the U.S. Government retains certain rights in this software.
 !
 ! Redistribution and use in source and binary forms, with or without
 ! modification, are permitted provided that the following conditions are
 ! met:
 !
 ! 1. Redistributions of source code must retain the above copyright
 ! notice, this list of conditions and the following disclaimer.
 !
 ! 2. Redistributions in binary form must reproduce the above copyright
 ! notice, this list of conditions and the following disclaimer in the
 ! documentation and/or other materials provided with the distribution.
 !
 ! 3. Neither the name of the Corporation nor the names of the
 ! contributors may be used to endorse or promote products derived from
 ! this software without specific prior written permission.
 !
 ! THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 ! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 ! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
 ! CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 ! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 ! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 ! PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 ! LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 ! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 ! SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 !
 ! Questions? Contact Karen Devine	kddevin@sandia.gov
 !                    Erik Boman	egboman@sandia.gov
 !
 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !
 ! @HEADER
-------> 
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="GENERATOR" content="Mozilla/4.7 [en] (X11; U; SunOS 5.7 sun4u) [Netscape]">
   <meta name="sandia.approved" content="SAND99-1376">
   <meta name="author" content="karen devine, kddevin@sandia.gov">
   <title> Zoltan Developer's Guide:  Compilation</title>

</head>
<body bgcolor="#FFFFFF">

<div ALIGN=right><b><i><a href="dev.html">Zoltan Developer's Guide</a>&nbsp; |&nbsp; <a href="dev_lb.html">Next</a>&nbsp; |&nbsp; <a href="dev_dist_dir.html">Previous</a></i></b></div>


<h2>
<a NAME="compilation"></a>Compilation and Makefiles</h2>
The Zoltan distribution includes a main (top-level) makefile with targets
for the Zoltan library, the test driver programs, and some graphical tools. 
When the library is
<a href="../ug_html/ug_usage.html#Building the Library">compiled for a specific target platform</a>, <i>A</i>, Autotools and CMake obtain provide
platform-specific configuration information.
<p>
Both the Autotools and CMake build systems must be maintained in Zoltan.
Thus, new source code files and directories must be added for both systems.
It is easiest to follow the examples of existing files in the build 
environments; good examples
are <i>hsfc.h</i>, <i>hsfc.c</i>, <i>dr_loadbal_const.h</i> and 
<i>dr_loadbal.c</i>.  
<p>
To add new source files or source directories:
<ul> 
<li> 
Autotools: Add new library files or directories to 
<i>zoltan/src/Makefile.am</i>; add
new driver files to <i>zoltan/src/driver/Makefile.am</i>.  
In the main
zoltan directory, run the <i>bootstrap-local</i> script to rebuild the 
automated Makefiles.
</li>
<li>
CMake:  Add new library files to <i>zoltan/src/CMakeLists.txt</i>; add
new driver files to <i>zoltan/src/driver/CMakeLists.txt</i>.
</li>
</ul>
<p>
Alternatively, new algorithms can be added as separate libraries with which 
Zoltan may link.  
The implementation of the <a href="../ug_html/ug_alg_parmetis.html">ParMETIS</a>
interface in Zoltan can serve as an example.  
<p>
To add new third-party libraries:
<ul>
<li>
Autotools:  Add checks new library paths and include files to 
<i>zoltan/configure.ac</i>.  Search for the string "parmetis" in 
<i>zoltan/configure.ac</i>, and follow 
its example for the new library.  
Also edit 
<i>zoltan/src/include/Zoltan_config.h.in</i> to include a macro for
the new third-party library; follow the example of "HAVE_PARMETIS".
In the main
zoltan directory, run the <i>bootstrap-local</i> script to rebuild the 
automated configure and Makefiles.
</li>
<li>
CMake:
Follow the instructions in <i>Trilinos/cmake/HOWTO.ADD_TPL</i>
In <i>zoltan/src/CMakeLists.txt</i> 
and <i>zoltan/cmake/Zoltan_config.h.in</i>, 
follow the example of "HAVE_PARMETIS".
</li>
</ul>

<hr WIDTH="100%">
<br>[<a href="dev.html">Table of Contents</a>&nbsp; |&nbsp; <a href="dev_lb.html">Next:&nbsp;
Zoltan Interface and Data Structures</a>&nbsp; |&nbsp; <a href="dev_dist_dir.html">Previous:&nbsp;
Layout of Directories</a>&nbsp; |&nbsp; <a href="https://www.sandia.gov/general/privacy-security/index.html">Privacy and Security</a>]
</body>
</html>
